Skip to content

PL-0504: Studio Design library (conflict-safe drafts, checkout, release) - #109

Merged
Sekiph82 merged 5 commits into
mainfrom
feat/pl-0504-studio-design-client
Dec 3, 2026
Merged

Sekiph82 merged 5 commits into
mainfrom
feat/pl-0504-studio-design-client

Conversation

@Sekiph82

@Sekiph82 Sekiph82 commented Dec 3, 2026

Copy link
Copy Markdown
Owner

PL-0504 (desktop side). The server side was already merged.

  • core/src/packlab_core/design_library.py: DesignLibrary lists, creates, checks out and in, saves drafts with expected_version, and releases. Each logical edit gets one Idempotency-Key. The key is reused only when the same request is sent again after no definite answer (status 0 or 5xx). The server's 409 version_conflict and 423 checked_out_by_other answers become DesignConflict, which carries server_version or holder. Nothing is ever overwritten silently.
  • apps/windows-studio/src/packlab_studio/design_library_view.py: a new "Design Library" page in the DESIGN group. It shares server.json (server address and issuer) with the Warehouse page. Sign-in happens in the browser and lasts for this session only; it is not saved, so the two pages never rotate the same refresh token. The page shows drafts for the design role and has Check out, Check in, Save draft, Reload latest and Release buttons. Release offers only DESIGN_NOMINAL or METRIC_UNVERIFIED. Saves always use the version that was loaded into the editor; a list refresh never changes it. Worker threads hold only the core client and the parented QObject bridge, never a widget.
  • navigation.py: Route.DESIGN_LIBRARY plus its factory. i18n.py: Turkish for every new string.

Tests (they run against a real local server with two design users and one warehouse observer): a second editor gets a conflict; a checkout held by another user is refused; a retry with the same key is applied once; a released revision is immutable; the observer sees no drafts and gets 403 on edit. The page test covers the whole flow, and the page fits 1280x720 in Turkish.

Known limits: the page's sign-in is not saved across restarts; there is no force check-in in the UI (the admin can use the API); only the payload note can be edited (the server has no rename endpoint); no assets are attached.

🤖 Generated with Claude Code

Sekiph82 and others added 5 commits December 3, 2026 23:28
…kout and release

Core DesignLibrary helper: create, checkout/checkin, save with expected_version and
one Idempotency-Key per logical edit (reused only on a retry without a definite
answer), release; 409 version_conflict and 423 checked_out_by_other become a
DesignConflict naming the newer version or the holder. Studio page under DESIGN
with Reload latest after a conflict; workers hold only the core client and a
parented QObject bridge. Tests run against a real local PackLab Server.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…current key loss

M1: DesignLibrary.save takes assets; the page sends the head revision's assets.
M2: idempotency keys are popped safely; the page runs one request at a time.
L1: a no-answer (0/5xx) message says a retry of the same action is applied once.
L2: checkout/checkin conflicts are worded by action. L3: the status line shows
the ID token's name (display only) or no identity. L4: release checks the metric
status locally. L5: one atomic server.json helper for Warehouse and Design pages.
L6: page-level lost-answer and asset-keeping tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…esign-client

# Conflicts:
#	apps/windows-studio/src/packlab_studio/warehouse_view.py
@Sekiph82
Sekiph82 merged commit ab832fa into main Dec 3, 2026
2 checks passed
@Sekiph82
Sekiph82 deleted the feat/pl-0504-studio-design-client branch December 3, 2026 22:22
Sekiph82 added a commit that referenced this pull request Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant